package com.xiaoshuidi.cloud.module.contract.convert.contract;

import com.xiaoshuidi.cloud.module.contract.controller.admin.contract.vo.ContractCreateReqVO;
import com.xiaoshuidi.cloud.module.contract.controller.admin.contract.vo.ContractExchangeReqVO;
import com.xiaoshuidi.cloud.module.contract.controller.admin.contract.vo.ContractRefundReqVO;
import com.xiaoshuidi.cloud.module.contract.controller.admin.contract.vo.company.CompanyContractRefundReqVO;
import com.xiaoshuidi.cloud.module.contract.controller.admin.contract.vo.settlement.*;
import com.xiaoshuidi.cloud.module.contract.dal.dataobject.contract.SettlementDO;
import com.xiaoshuidi.cloud.module.contract.dal.dataobject.contract.SettlementDetailDO;
import com.xiaoshuidi.cloud.module.contract.dal.dataobject.contract.SettlementExtDO;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;

import java.util.List;

/**
 * 合同结算 Convert
 *
 * @author 合房租赁
 */
@Mapper
public interface SettlementConvert {

    SettlementConvert INSTANCE = Mappers.getMapper(SettlementConvert.class);

    SettlementDO convert(SettlementCreateReqVO bean);

    SettlementDO convert(ContractRefundReqVO reqVO);

    SettlementDO convert(CompanyContractRefundReqVO reqVO);

    SettlementDO convert(ContractCreateReqVO reqVO);

    SettlementDO convert(ContractExchangeReqVO reqVO);

    ContractSettlementCompanyListReqVO convert(SettlementDO bean);

    CompanyContractRefundReqVO convert1(SettlementDO bean);

    List<SettlementDetailBaseVO> convertList(List<SettlementDetailDO> bean);

    ContractSettlementWithDetailRespVO convertToSettlementWithDetail(SettlementDO bean);

    List<ContractSettlementGetListRespVO> convert(List<SettlementExtDO> data);

    @Mapping(target = "payeeName", source = "customerName")
    @Mapping(target = "payeeBankProvince", source = "bankProvince")
    @Mapping(target = "payeeBankCity", source = "bankCity")
    @Mapping(target = "payeeBankCode", source = "bankCode")
    @Mapping(target = "payeeBankName", source = "customerBank")
    @Mapping(target = "payeeBankAccount", source = "customerCreditCard")
    @Mapping(target = "payeeBankBranch", source = "customerBankArea")
    @Mapping(target = "attachment", source = "certificateUrl")
    @Mapping(target = "processInstance", source = "processInstanceId")
    ContractSettlementGetListRespVO convert(SettlementExtDO data);

    List<ContractSettlementExcelVO> convert01(List<SettlementExtDO> settlementExtDOS);

    ContractSettlementGetListReqVO convert(ContractSettlementReqExcelVO req);

    ContractCompanyBatchSettlementVO convertCompany(SettlementDO settlementDO);
}
